#include<bits/stdc++.h>
using namespace std;
int sum,i,j,n,b[100001];
struct node{
    int x;
    bool f,s;
}a[100001];
bool cmp(node a,node b){
    return a.x<b.x;
}
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(i=1;i<=n;i++){
        scanf("%d",&a[i].x);
        a[i].f=0;
        b[a[i].x]++;
    }

    if(b[1]+b[2]==n){
        if(b[1]<=b[2])
            printf("%d",n-b[1]);
        else printf("%d",n-b[2]);
        exit(0);
    }
    sort(a+1,a+n+1,cmp);
    int pos=2;
    for(i=1;i<=n;i++){
        for(j=pos;j<=n;j++){
            if(a[i].x==a[j].x) continue;
            if(a[i].x<a[j].x&&a[j].s==0){
                a[i].f=1;
                sum++;

                a[j].s=1;
                pos=j+1;
                break;
            }
        }
    }
    cout<<n-sum<<endl;
    return 0;
}
